package com.zlll.winner.controller.advertise;

import com.alibaba.fastjson.JSONObject;
import com.zlll.winner.business.service.advertising.IAdvertisingSpaceService;
import com.zlll.winner.common.BaseController;
import com.zlll.winner.common.BaseResult;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 广告位管理管理
 */
@RestController
@RequestMapping(value = "/advertise/space")
public class AdvertiseSpaceController extends BaseController {

    @Reference
    private IAdvertisingSpaceService iAdvertisingSpaceService;

    /**
     * 获取位置信息
     * @param data
     * @return
     */
    @PostMapping("getMoreSpace")
    public BaseResult getSpaceByTypeAndCategory(@RequestBody JSONObject data) {
        BaseResult baseResult = new BaseResult();
        Integer type = data.getInteger("type");
        Integer category = data.getInteger("category");
        List list = iAdvertisingSpaceService.getSpaceByTypeAndCategory(type,category);
        baseResult.setData(list);
        return baseResult;
    }
}
